const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

/**
 * Export model definition object.
 */
module.exports = {
  projectId: { type: ObjectId },
  versionId: { type: ObjectId },
  taskId: String,
  phoenixTaskId: String,
  type: String,
  content: String,
  status: {
    type: String,
    enum: ['pending', 'succeed', 'failed', 'canceled'],
  },
  tryCnt: {
    type: Number,
    default: 0,
  },
  errMsg: String,
  ackNo: Number,
  createdAt: {
    type: Date,
  },
  modifiedAt: {
    type: Date,
  },
};
